import 'package:flutter/material.dart';
import 'package:flutter_chubao/tools/app_colors.dart';
import 'package:flutter_chubao/tools/app_textstyle.dart';
import 'package:flutter_chubao/widgets/app_widget_appbar.dart';
import 'package:flutter_chubao/widgets/app_widget_space.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

import 'app_mine_protocols_logic.dart';
import 'app_mine_protocols_state.dart';

/// @description:
/// @author
/// @date: 2023-12-15 10:26:58
class AppMineProtocolsPage extends StatelessWidget {
  final AppMineProtocolsLogic logic = Get.put(AppMineProtocolsLogic());
  final AppMineProtocolsState state = Get.find<AppMineProtocolsLogic>().state;

  AppMineProtocolsPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppWidgetAppbar(
          titleStr: '我的协议',
        ),
        body: SingleChildScrollView(
            padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 10.w),
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                Container(
                  padding: EdgeInsets.symmetric(horizontal: 14.w),
                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(2.w)),
                  child: Wrap(
                    children: state.products
                        .map((e) => InkWell(
                              onTap: () {
                                logic.clickProtocol(
                                    e); // logic.clickRowsList(e);
                              },
                              child: SizedBox(
                                height: 45,
                                child: Column(
                                  children: [
                                    Expanded(
                                      child: Row(
                                        children: [
                                          Expanded(
                                              child: Text(
                                            e['title'] ?? '',
                                            style:
                                                AppTextStyle.getNormalTextStyle(
                                                    fontSize: 15),
                                          )),
                                          Icon(
                                            Icons.arrow_forward_ios,
                                            color: kColorTextB40,
                                            size: 14,
                                          )
                                        ],
                                      ),
                                    ),
                                    AppWidgetSpace()
                                  ],
                                ),
                              ),
                            ))
                        .toList(),
                  ),
                ),
                SizedBox(
                  height: 10.w,
                ),
              ],
            )));
  }
}
